﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Data.OracleClient;

namespace EntityCodeGenerate
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void BtnConfirm_Click(object sender, EventArgs e)
        {
            string connStr = "Server={0};Database={1};User Id={2};Password={3};";
            connStr = string.Format(connStr, TxtAddress.Text.Trim(), TxtDataBase.Text.Trim(), TxtUserId.Text.Trim(), TxtPwd.Text.Trim());
            SqlConnection conn = new SqlConnection(connStr);
            SqlCommand cmd = new SqlCommand("select id,name from sysobjects where xtype='U'", conn);
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataSet ds = new DataSet();
            da.Fill(ds);

            TableList tableList = new TableList();
            tableList.tableSource = ds;
            tableList.ShowDialog();
        }
    }
}
